<form action="{php echo web_url('distribution/dissysbase/editdistributor')}" method="post" class="form-horizontal form form-validate">
	<div class="modal-dialog" style="z-index: 50;">
		<div class="modal-content" style="max-height: 1000px;">
			<div class="modal-header">
				<button data-dismiss="modal" class="close" type="button">×</button>
				<h4 class="modal-title">编辑{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}</h4>
			</div>
			<div class="modal-body" style="margin-left: 100px;">
				<div class="form-group">
					<label class="col-sm-2 control-label">用户昵称</label>
					<div class="col-md-7">
						<input type="text" name="nickname"  class="form-control" value="{$distri['nickname']}"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">真实姓名</label>
					<div class="col-md-7">
						<input type="text" name="realname"  class="form-control" value="{$distri['realname']}"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">联系方式</label>
					<div class="col-md-7">
						<input type="text" name="mobile"  class="form-control" value="{$distri['mobile']}"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">上级</label>
					<div class="col-md-7">
						<select name="leadid" class="form-control col-sm-7 col-xs-6 chosen-select" style="width: 100%;">
							<option value="{$distri['leadid']}" selected="selected">{$distri['leadname']}</option>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">等级</label>
					<div class="col-md-7">
						<select name="dislevel" class="form-control">
							{loop $levels $cate}
	                        	<option value="{$cate['id']}" {if $distri['dislevel'] == $cate['id']}selected="selected"{/if}>{$cate['name']}</option>
	                        {/loop}
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">余额</label>
					<div class="col-md-7">
						<div class="form-control-static">
							￥{$distri['nowmoney']}
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">{if Customized::init('distributionText') > 0}共享股东{else}分销商{/if}来源</label>
					<div class="col-xs-12 col-sm-8">
						<label class="radio-inline" >
							<input type="radio" name="source" value="1"  {if $distri['source']} checked {/if}>后台添加
						</label>
						<label class="radio-inline" >
							<input type="radio" name="source" value="0" {if $distri['source'] != 1} checked {/if}>用户申请
						</label>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">余额操作</label>
					<div class="col-xs-12 col-sm-8">
						<label class="radio-inline" >
							<input type="radio" name="moneytype" value="1" checked>增加
						</label>
						<label class="radio-inline" >
							<input type="radio" name="moneytype" value="2" >减少
						</label>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">操作余额</label>
					<div class="col-md-7">
						<input type="text" name="money"  class="form-control" value="" placeholder="请输入修改余额数字,最多保留两位小数" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">操作原因</label>
					<div class="col-md-7">
						<input type="text" name="reason"  class="form-control" value="" placeholder="请输入修改余额的原因" />
					</div>
				</div>
			</div>
			<div class="modal-footer">
				<input type="hidden" name="id" id="id" value="{$distri['id']}" />
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="submit" class="btn btn-primary">提交更改</button>
			</div>
		</div>
	</div>
</form>
<script>
	$(document).on('show.bs.modal', '.modal', function(event) {
        $(this).appendTo($('body'));
    }).on('shown.bs.modal', '.modal.in', function(event) {
        setModalsAndBackdropsOrder();
    }).on('hidden.bs.modal', '.modal', function(event) {
        setModalsAndBackdropsOrder();
    });


    function setModalsAndBackdropsOrder() {  
        var modalZIndex = 1040;
        $('.modal.in').each(function(index) {
            var $modal = $(this);
            modalZIndex++;
            $modal.css('zIndex', modalZIndex);
            $modal.next('.modal-backdrop.in').addClass('hidden').css('zIndex', modalZIndex - 1);
        });
        $('.modal.in:visible:last').focus().next('.modal-backdrop.in').removeClass('hidden');
    }
</script>
